<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0px;
            padding: 0px;
        }
        div{
            height: 2000px;
            width: auto;
            background-color: rgb(147, 179, 177);
        }
        .box {
            height: 300px;
            width: 150px;
            position: fixed;
            right: 0px;
            top: 250px;
            background-color: lawngreen;
        }
        .box button {
            border: 0px;
            box-sizing: border-box;
            text-align: center;
            width: 15px;
            height: 15px;
            font-size: 14px;
            line-height: 15px;
            background-color: #666;
            color: #fff;
            position: absolute;
            right: 0px;
            top: 0px;
        }
    </style>
</head>
<body>
    <div class="box">
        <button>x</button>
        我<br>是<br>流<br>氓<br>广<br>告
    </div>
    <div>
        
    </div>
    <script>
        var btnEle = document.querySelector(".box button") ; 
        var divEle = document.querySelector(".box");
        btnEle.onclick = function (){
            divEle.style.display = "none" ;
            var timer = setTimeout(function(){
                divEle.style.display = "block" ;
            },3000);
        }
    </script>
</body>
</html>